/*
 * @Author: 张晨旭
 * @Date: 2021-04-23 12:57:37
 * @LastEditTime: 2021-04-29 11:11:56
 * @LastEditors: 韩双双
 * @Description: In User Settings Edit
 * @FilePath: \riboa\daily-1807a-6\项目代码\project2\wipi\src\components\Archive.tsx
 */

import useStore from "@/context/useStore"
import React, { useEffect, useState } from "react"
import { observer } from "mobx-react-lite"
import styles from "./ArchiveSon.less"

const ArchiveSon = () => {
    const {file} = useStore()
    const [i, setI] = useState(0)

    useEffect(() => {
       file.getFile()
       setI(Iindex)
    }, [])
    function Iindex(){
        let i = 0;
        Object.keys(file.FileList).map(item=>{
            Object.keys(file.FileList[item]).map(it=>{
                Object.values(file.FileList[item][it]).map(em=>{
                        i++
                })
            })
        })
        return i
    }
    
    return <div className={styles.topBox}>
        
        <p> <span>  归档  </span></p>
        <p> 共计 <span> {i} </span> 篇 </p>
    </div>
}
export default observer(ArchiveSon)